<%@page import="com.htsoft.admin.model.AppUser"%>
<%@page import="com.htsoft.core.util.SysConfig"%>
<%@page import="com.htsoft.admin.service.AppUserService"%>
<%@page import="com.htsoft.core.Constants"%>
<%@page import="com.htsoft.register.model.Member"%>
<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="common.jsp" %>

<%
	AppUserService aus = (AppUserService)SystemConfig.getBean("appUserService");
	String mid = (String) session.getAttribute("mid");
	String sid = (String) session.getAttribute("sid");
	
	//TODO 此部分需要去掉0816的判断，暂时只为测试提供此服务中心
	//if(sid == null || "".equals(sid)){
		//sid = Constants.DEFAULT_SID;
	//}
	
	Member member = (Member)session.getAttribute(Constants.SESSION_UESR);
	if(member == null){
		member = new Member();
		member.setState("-2");//设置为不存在的状态，已标记用户未注册
	}else{
		sid = member.getSid();
	}
	
	AppUser appUser = null;
	AppUser au = (AppUser)session.getAttribute(Constants.SESSION_APPUSER_CACHE);
	if(au == null){
		appUser = aus.findByCodeNum(sid);//获取服务中心相关信息
	}else{
		if(!sid.equals(au.getCodeNum())){
	appUser = aus.findByCodeNum(sid);//获取服务中心相关信息
		}else{
	appUser = au;
		}
	}
	
	String state = member.getState();
	String stateStr = "";
	if("-2".equals(state)){
		stateStr = "正在注册... ...";
	}else if("0".equals(state)){
		stateStr = "审核中... ...";
	}else if("7".equals(state)){
		stateStr = "审核通过，可以进行交易... ...";
	}else{
		stateStr = "资料补充中... ...";
	}
%>
<% 
	if(appUser != null && !"".equals(appUser.getFullname())){
%>
<div class="col-sub">
	<div class="gridLeft">
		<div class="signSide otherThing">
			<div class="sign_side_hd" style="position:relative">
				<h2>账户查询</h2>
				<% if(!"-2".equals(member.getState())){ %>
				<a href="<%=path %>/logout.do" style="position:absolute;right:0;top:0;font-size:14px;padding-top:2px;">注销登录</a>
				<% } %>
			</div>
			<div class="sign_side_bd" style="font-size: 14px">
				<p>
					当前账户状态：<%=stateStr %>
				</p>
			</div>
		</div>
		<!--signSide end-->

		<div class="signSide difWay">
			<div class="sign_side_bd">
				<p style="font:24px 'Microsoft YaHei','SimSun'; margin-bottom:10px">
					<%=appUser.getFullname() %>
				</p>
				<p style="font-size: 16px; font-family: '微软雅黑'">
					客服热线：<%=appUser.getPhone() %>
				</p>
				<p style="font-size: 16px; font-family: '微软雅黑'">
					传真：<%=appUser.getFax() %>
				</p>
			</div>
		</div>
		<!--signSide end-->

	</div>
	<!--gridLeft end-->
</div>
<%
	}else{
%>
<script type="text/javascript">
	window.location.href = "<%=path %>/common/midInexistence.jsp";
</script>
<%	} %>
<!--col-sub end-->